﻿@model IEnumerable<DLM.Domain.Model.User>
@using Webdiyer.WebControls.Mvc;
<div class="friend_list">
    <ul class="clearfix">
        @foreach (var item in Model)
        {
@*                          
            <li><a href="@Url.Action("View", "User", new { id = item.UserID })">
                <img src="@Url.Content("~/Files/Photos/" + item.UserID + "/Title/" + item.Photo)" alt="" />
            </a>
                <p>
                    <a href="@Url.Action("View", "User", new { id = item.UserID })">@item.Name</a></p>
                <span><a href="#" onclick="setUser(@item.UserID);" class="hi">打招呼</a>| |
                    
                </span></li>*@
                             
            <li>
                <div class="friend_item">
                    <div class="friend_pic">
                        <a href="@Url.Action("View", "User", new { id = item.UserID })">
                            @if (item.Photo == "none_75_75.png")
                            {
                                <img src="@Url.Content("~/Content/ad/none_75_75.png")" alt="头像" height="77px" width="77px"/>
                            }
                            else
                            {   <img src="@Url.Content("~/Files/Photos/" + item.UserID + "/Title/" + item.Photo)" alt="" />}
                        </a>
                        <div class="tips">
                            姓名： @item.Name &nbsp;
                            <br />
                            年龄：@item.Age &nbsp;性别：
                            @if (item.Gender.Value == true)
                            {
                                <span>女</span>
                            }
                            else
                            {
                                <span>男</span>
                            }
                            <br />
                            居住在：@item.Location
                            <span class="tra"></span>
                        </div>
                    </div>
                    <div class="friend_info">
                        <a href="@Url.Action("View", "User", new { id = item.UserID })">@item.AccountName</a></div>
                    <div class="friend_act">
                        <div class="friend_act_left">
                            <a href="" onclick="setUser(@item.UserID);" class="hi">打招呼</a></div>
                        <div class="friend_act_right">
                            @Ajax.ActionLink("加为好友", "Invite", "Friend", new { id = item.UserID }, new AjaxOptions { HttpMethod = "Post", OnBegin = "validateApply", OnFailure = "onInvitateFalied", OnSuccess = "onInvitateSuccessed" })
                            @*  <input type="button" class="btn" value="知道了" />*@
                        </div>
                    </div>
                </div>
            </li>         
        }
    </ul>
    <div class="paging">
        @Ajax.Pager(Model as PagedList<DLM.Domain.Model.User>, new PagerOptions
{
    PageIndexParameterName = "participantid",
    CurrentPagerItemWrapperFormatString = "<span class=\"current\">{0}</span>",
    //NumericPagerItemWrapperFormatString = "<a>{0}</a>",
    PrevPageText = "<",
    NextPageText = ">",
    ShowNumericPagerItems = true,
    ShowFirstLast = false,
    ShowPrevNext = true,
    CssClass = "scott",
    MorePageText = "...",
    SeparatorHtml = ""
},
           new AjaxOptions { UpdateTargetId = "divParticipant" }
    )
    </div>
</div>
